package com.szu.subject.ui.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.szu.subject.domains.Address;
import com.szu.subject.ui.mapper.AddressMapper;
import com.szu.subject.ui.service.AddressService;
/**
 * 
 * @author Shenxiaolin
 *
 */
@Service
public class AddressServiceImpl implements AddressService {

	@Autowired
	private AddressMapper addressMapper;
	@Override
	public List<Address> getAllAddress() {
		return addressMapper.getAllAddresses();
	}

	@Override
	public Address createAddress(Address address) {
		addressMapper.createAddress(address);
		return address;
	}

	@Override
	public Address updateAddress(Address address) {
		addressMapper.updateAddress(address);
		return address;
	}

	@Override
	public int deleteAddress(Long id) {
		return addressMapper.deleteAddress(id);
	}

	@Override
	public List<Address> batchCreateAddresses(List<Address> addresss) {
		addressMapper.batchCreateAddresses(addresss);
		return addresss;
	}

	@Override
	public List<Address> batchUpdateAddresses(List<Address> addresss) {
		addressMapper.batchUpdateAddresses(addresss);
		return addresss;
	}

	@Override
	public int batchDeleteAddresses(List<Long> ids) {
		return addressMapper.batchDeleteAddresses(ids);
	}

	@Override
	public Address getAddressByPK(Long id) {
		return addressMapper.getAddressByPK(id);
	}

}
